.TH E1432_SET_ACTIVE 3 E1432
.SH NAME
.nf
e1432_set_active \- Set a group or channel active
e1432_get_active \- Get group or channel active state
.fi
.IX e1432_set_active(3) 3
.IX e1432_get_active(3) 3
.SH SYNOPSIS
.cS
SHORTSIZ16 e1432_set_active(E1432ID hw, SHORTSIZ16 ID,SHORTSIZ16 state)
SHORTSIZ16 e1432_get_active(E1432ID hw, SHORTSIZ16 ID,SHORTSIZ16 *state)
.cE
.SH DESCRIPTION
An application can use the E1432 interface library to communicate with
several E1432 modules, each of which has multiple channels.
Obviously, the application will not always want to use all of the
channels.  The \fIe1432_set_active\fR function is used to specify
which of the channels the application wants to use.

Channels that are "inactive" are not used at all in a measurement.
The active/inactive status of a channel can't be changed while a
measurement is running.  For an input channel, if it is inactive then
it will not assert trigger, and its data will not get put into the
FIFO.  For a tach channel, if it is inactive then the RPM of that
channel is not monitored and the raw tach times can't be read by the
host computer.  For a source channel, if it is inactive then the
channel will not produce an output signal.

Changing an input channel from active to inactive, or from inactive to
active, will abort any currently running measurement.  Changing a
source channel from inactive to active will not start a source, only
\fIe1432_init_measure\fR does that.  However, changing a source
channel from active to inactive stops the source immediately.
Changing a tach channel from active to inactive, or from inactive to
active, will have no effect until the start of the next measurement.

Compare this with \fIe1432_set_enable\fR, which can enable or disable
data from a input channel while a measurement is running.

\fIe1432_get_active\fR returns the state of a channel or group.

\fIhw\fR must be the result of a successful call to
\fIe1432_assign_channel_numbers\fR, and specifies the group of
hardware to talk to.

If the \fIID\fR is a channel ID, that one channel is set to
\fIstate\fR.

The \fIstate\fR can be either E1432_CHANNEL_ON, E1432_CHANNEL_OFF, or
E1432_CHANNEL_MAYBE.  If \fIstate\fR is E1432_CHANNEL_MAYBE, then
source channels are set to E1432_CHANNEL_OFF, while input and tach
channels are set to E1432_CHANNEL_ON.

A call to \fIe1432_create_channel_group\fR automatically calls
\fIe1432_set_active\fR using parameter E1432_CHANNEL_MAYBE for the new
group so in the simple case of one group, the programmer never needs
to call \fIe1432_set_active\fR.

Unlike the E1432 library, in the E1431 library calling this function
sets all channels in each module to E1431_CHANNEL_OFF, and then sets
the specified channels to \fIstate\fR.  This "feature" is undesirable
and is not duplicated in the E1432 library.  The E1431 library does
not have a E1431_CHANNEL_MAYBE parameter.

.SH "RESET VALUE"
See above.
.SH "RETURN VALUE"
Return 0 if successful, a (negative) error number otherwise.
.ne 3
.SH "SEE ALSO"
.na
e1432_create_channel_group, e1432_set_enable, e1432_e1431_diff
.ad
